package com.example.zhengsr.surfaceboard;

import android.content.Context;
import android.net.wifi.WifiManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.example.zhengsr.surfaceboard.socket.UDPProvider;

import java.util.UUID;

public class MainActivity extends AppCompatActivity {

    private DrawView mDrawView;
   // private UdpProvider mProvider;
    private WifiManager.MulticastLock mLock;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mDrawView = findViewById(R.id.surface);
       /* WifiManager manager = (WifiManager) this.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
        mLock = manager.createMulticastLock("test wifi");
        mLock.acquire();	//申请广播开启
*/
      //  mProvider = new UdpProvider();
     //   mProvider.start();
        String sn = UUID.randomUUID().toString();
        UDPProvider.Provider mProvider = new UDPProvider.Provider(sn);
        mProvider.start();



    }

    public void clear(View view) {
        mDrawView.clear();
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
     //   mProvider.exit();
       // mLock.release();

    }
}
